import request from "../utils/request";
export interface IAddress {
    name: string,
    tel: string,
    province: string,
    city: string,
    county: string,
    addressDetail: string,
    areaCode: string,
    isDefault: 0 | 1,
    customer: string
}
export interface IEditaddr extends IAddress {
    id: string
}
export class Address {
    //不同的发送post请求方法1
    static add = (address: IAddress) => request.post('/address/add', address)//添加不用传入id，id可以后端自己生成
    //不同的发送post请求方法3
    // static add=(address:IAddress)=>request.post('/address/add',{...address})
    //不同的发送post请求方法2
    // static add=(address:IAddress)=>request({url:'/address/add',method:"POST",data:address})
    static getAddrList = (customerid: number) => request.get('/address/getaddress', { params: { customerid } })
    static getAaddr = (addrid: number) => request.get('/address/getaaddr', { params: { addrid } })
    static editaddr = (address: IEditaddr) => request.post('/address/edit', address)//编辑需要地址id
    static deladdr=(addrid:number)=>request.get('/address/deladdr',{ params: { addrid } })
}